import json


accessKeyId = "你的账户"
accessSecret = "你的秘钥"

city = "cn-hangzhou"  # 默认杭州节点不要修改

query_DomainName = "你的域名"  # 查询的域名例如pcoc.top,不要填写[www.pcoc.top]这样的
query_RR = ""  # 查询的子域名(已废弃)填空即可

write_Type = "A"  # 重新配置的记录类型，默认为ipv4 A类
write_Value = "1.2.3.4"  # 设置的IP地址默认为空，支持IPv4/IPv6（无需修改）
write_TTL = 600  # TTL时间，默认为600


def Config_Read():
    global accessKeyId,accessSecret,city,query_DomainName,write_Type,write_Value,write_TTL

    jsonconfig = open("config.json", 'r+')
    jscode = str(jsonconfig.read())
    text = json.loads(jscode)
    # print(type(text))
    # print(text)
    jsonconfig.close()
    accessKeyId = text["accessKeyId"]
    accessSecret = text["accessSecret"]
    city = text["city"]
    query_DomainName = text["query_DomainName"]
    write_Type = text["write_Type"]
    write_Value = text["write_Value"]
    write_TTL = text["write_TTL"]


if __name__ == "__main__":
    Config_Read()
    print(accessKeyId,accessSecret,city,query_DomainName,write_Type,write_Value,write_TTL)
